<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <h:form id="cepForm" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Médico
                </h1>
                <p:messages showDetail="true" autoUpdate="true"  /> 
                <div class="container_24 clearfix">
                    <div class="grid_24"> 
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Filtros</h4></legend>
                            <p:panel id="filter" style="background: none; border: none;" 
                                     styleClass="grid_24">
                                <p:outputLabel value="Nome:" styleClass="grid_3"/>
                                <p:inputText styleClass="grid_20" value="#{managerSearchDoctor.searchDoctor.name}"/>
                            </p:panel>
                        </fieldset>
                        <div class="buttonAction">
                            <p:commandButton value="Pesquisar" icon="ui-icon-disk"
                                             process="@form" update="@form" actionListener="#{managerSearchDoctor.search()}"
                                             styleClass="ui-priority-primary" />
                            <p:button href="indexdoctor.xhtml" value="Cancelar"  icon="ui-icon-arrowreturnthick-1-w" />
                        </div >
                        <div class="clear"/>
                        <p:dataTable var="dct" id="doctorDataTable" value="#{managerSearchDoctor.doctors}"  
                                         style="white-space: pre-wrap;" selectionMode="single" rowKey="#{dct.id}"
                                         emptyMessage="Nenhum registro encontrado" sortMode="multiple"
                                         paginatorPosition="bottom" paginator="true" rows="5"
                                         styleClass="grid_24"
                                         >
                                <f:facet name="header">
                                    Médicos
                                </f:facet> 
                                <p:column headerText="Ação" style="width: 50px; vertical-align: middle;">  
                                    <p:button icon="ui-icon-pencil" title="Editar Médico" alt="Editar Médico"
                                              href="editdoctor.xhtml?doctorEdit=#{dct.id}" style="width: 25px; position: relative;"/>
                                    <p:button icon="ui-icon-search" title="Visualizar Médico" alt="Visualizar Médico"
                                              href="showdoctor.xhtml?doctorShow=#{dct.id}" style="width: 25px; position: relative;"/>
                                    
                                </p:column> 
                                <p:column  headerText="Nome" >  
                                    <h:outputLabel value="#{dct.name}" />  
                                </p:column>
                                
                            </p:dataTable>
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
